<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改密码--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="format-detection" content="telephone=no"/>
    <link href="/resource/css/index.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css" media="all"/>
</head>

<body class="index">
<div class="book_con01">
    <div class="layui-form">
        <div class="top">
            <div>
                <div class="top_out">
                    <table class="table" style="width: 100%">
                        <tbody>
                        <tr>
                            <td>商品编号<span></span></td>
                            <td colspan="8"><input type="text" class="layui-input" name="productUuid"
                                                   placeholder="请输入商品名称"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        <tr>
                            <td>数量<span></span></td>
                            <td colspan="8"><input type="number" class="layui-input" name="number"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        <tr>
                            <td>配送方式<span></span></td>
                            <td colspan="8"><select name="mode">
                                <option>自取</option>
                                <option>配送</option>
                            </select></td>
                        </tr>
                        <tr>
                            <td>收货地址<span></span></td>
                            <td colspan="8"><input type="text" class="layui-input" name="address"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        <tr>
                            <td><span>购买人</span></td>
                            <td colspan="8"><input type="text" class="layui-input" name="userName"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        <tr>
                            <td><span>联系方式</span></td>
                            <td colspan="8"><input type="text" class="layui-input" name="iphone"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        <tr>
                            <td>备注<span></span></td>
                            <td colspan="8"><input type="text" class="layui-input" name="content"
                                                   minlength="2"
                                                   lay-verify="required"></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <div class="notice_bot">
            <div class="r_right but_p">
                <button class="but_save layui-btn" lay-submit="" lay-filter="Submit" style="padding: 0">保存
                </button>
                <button class="but_close" onclick="Cancel()">关闭</button>
            </div>
        </div>
        <div style="clear: both;padding-bottom: 40px"></div>
    </div>
</div>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript">

    var Cancel;
    layui.use(['table', 'layer', 'upload', 'form'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            upload = layui.upload,
            form = layui.form;
        Cancel = function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        }
        form.on('submit(Submit)', function (data) {
            data.field.address = data.field.address + "/" + data.field.userName + "/" + data.field.iphone
            $.ajax({
                url: '/order/sale.do',
                type: 'post',
                data: data.field,
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (!result.status) {
                        parent.layer.msg(result.msg, {time: 2000});
                        return false;
                    } else {
                        parent.layer.msg("操作成功!", {time: 1000});
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                        parent.layui.table.reload('tableId', {});
                    }
                }

            });
        });
    });

</script>

</body>
</html>